.class Lcom/trademob/tracking/TMManifestReader;
.super Ljava/lang/Object;
.source "TMManifestReader.java"


# instance fields
.field private myApplicationName:Ljava/lang/String;

.field private final myPackageName:Ljava/lang/String;

.field private myPackageVersion:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/trademob/tracking/TMUtility;)V
    .locals 6
    .parameter "aContext"
    .parameter "aTMUtility"

    .prologue
    .line 24
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 26
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    .line 27
    .local v1, bufferedContext:Landroid/content/Context;
    invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v3

    .line 28
    .local v3, packageManager:Landroid/content/pm/PackageManager;
    invoke-virtual {v1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v4

    iput-object v4, p0, Lcom/trademob/tracking/TMManifestReader;->myPackageName:Ljava/lang/String;

    .line 31
    :try_start_0
    invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v4

    const/4 v5, 0x0

    invoke-virtual {v3, v4, v5}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object v4

    iget-object v4, v4, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;

    iput-object v4, p0, Lcom/trademob/tracking/TMManifestReader;->myPackageVersion:Ljava/lang/String;

    .line 32
    iget-object v4, p0, Lcom/trademob/tracking/TMManifestReader;->myPackageName:Ljava/lang/String;

    const/4 v5, 0x0

    invoke-virtual {v3, v4, v5}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;

    move-result-object v0

    .line 33
    .local v0, appInfo:Landroid/content/pm/ApplicationInfo;
    invoke-virtual {v3, v0}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;

    move-result-object v4

    invoke-interface {v4}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v4

    iput-object v4, p0, Lcom/trademob/tracking/TMManifestReader;->myApplicationName:Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 40
    .end local v0           #appInfo:Landroid/content/pm/ApplicationInfo;
    :goto_0
    return-void

    .line 35
    :catch_0
    move-exception v2

    .line 37
    .local v2, e:Ljava/lang/Exception;
    const-string v4, "0"

    iput-object v4, p0, Lcom/trademob/tracking/TMManifestReader;->myPackageVersion:Ljava/lang/String;

    .line 38
    const-string v4, ""

    iput-object v4, p0, Lcom/trademob/tracking/TMManifestReader;->myApplicationName:Ljava/lang/String;

    goto :goto_0
.end method


# virtual methods
.method public getAppVersion()Ljava/lang/String;
    .locals 1

    .prologue
    .line 44
    iget-object v0, p0, Lcom/trademob/tracking/TMManifestReader;->myPackageVersion:Ljava/lang/String;

    return-object v0
.end method

.method public getApplicationName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 54
    iget-object v0, p0, Lcom/trademob/tracking/TMManifestReader;->myApplicationName:Ljava/lang/String;

    return-object v0
.end method

.method public getPackageName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 49
    iget-object v0, p0, Lcom/trademob/tracking/TMManifestReader;->myPackageName:Ljava/lang/String;

    return-object v0
.end method
